﻿//-----------------------------------------------------------------------
// <copyright file="IDbContextTypeResolver.cs" company="SLWY Enterprises">
// * Copyright (C) 2017 四川商旅无忧科技有限公司 版权所有。
// * version : 1.0
// * author  : qinchaoyue
// * FileName: IContextTypeResolver.cs
// * history : created by qinchaoyue 2017-12-14 05:18:28
// </copyright>
//-----------------------------------------------------------------------


namespace Slwy.Data.Entity
{
    using Slwy.Data.Entity.Interfaces;
    using Slwy.FrameCore.Dependency;

    /// <summary>
    /// 数据库上下文创建器
    /// </summary>
    public interface IDbContextTypeResolver : ISingletonDependency
    {
        /// <summary>
        /// 由实体类型获取关联的上下文类型
        /// </summary>
        /// <typeparam name="TEntity">实体类型</typeparam>
        /// <typeparam name="TKey">实体主键类型</typeparam>
        /// <returns></returns>
        IUnitOfWork Resolve<TEntity, TKey>() where TEntity : IEntityBase<TKey>;
    }
}
